#ifdef FS_DIFFUSEMAP
	varying vec2 VertexTexCoordVS;
#endif

uniform vec4 DiffuseColor;
#ifdef FS_DIFFUSEMAP
	uniform sampler2D DiffuseMap;
	#ifdef FS_ALPHATEST
		uniform float AlphaReference;
	#endif
#endif

void main()
{
#ifdef FS_DIFFUSEMAP
	vec4 final_clr = texture2D(DiffuseMap, VertexTexCoordVS);
	#ifdef FS_ALPHATEST
		if (final_clr.a < AlphaReference)
		{
			discard;
		}
	#endif
	
	gl_FragColor = final_clr * DiffuseColor;
#else
	gl_FragColor = DiffuseColor;
#endif
}